export default {
  // 基础尺寸配置
  base: {
    designWidth: 932,  // 设计基准宽度
    designHeight: 430, // 设计基准高度
    minWidth: 932,    // 最小支持宽度
    minHeight: 430    // 最小支持高度
  },
  
  // 玩家设置
  player: {
    gravity: 0.8,         // 增加重力，使下落更快
    jumpForce: -15,       // 增加跳跃力度，使跳跃更高
    maxJumps: 1,         // 初始只能跳一次
    jumpMultiplier: 1.2,  // 增加二段跳的力度
    width: 64,  // 与精灵图帧大小一致
    height: 64, // 与精灵图帧大小一致
    invincibleTime: 60,
    // 能力解锁条件
    abilities: {
      doubleJump: {
        requiredCarrots: 10,  // 需要收集10个胡萝卜解锁二段跳
        name: "二段跳",
        description: "在空中可以再次跳跃！"
      }
    },
    // Boss战时的特殊参数
    bossMode: {
      jumpForce: -12,     // Boss战时的跳跃力度也相应增加
      gravity: 0.9        // Boss战时的重力更大
    }
  },
  
  // 精灵图配置
  spriteConfig: {
    totalFrames: 14,
    framesPerRow: 7,
    rows: 2,  // 确保明确定义行数
    frameWidth: 64,
    frameHeight: 64,
    animationSpeed: 0.2,
    animations: {
      idle: {
        startFrame: 0,
        endFrame: 3,
        speed: 0.1  // 降低速度使动画更平滑
      },
      run: {
        startFrame: 4,
        endFrame: 9,
        speed: 0.2
      },
      jump: {
        startFrame: 10,
        endFrame: 11, // 只用上升帧
        speed: 0.15
      },
      fall: {
        startFrame: 12,
        endFrame: 13, // 使用下降帧
        speed: 0.15
      }
    }
  },
  
  // 平台配置
  platform: {
    width: 120,         // 基础平台宽度更窄，增加跳跃难度
    height: 20,         // 降低平台高度，让跳跃更精准
    gap: {
      min: 180,        // 最小水平间距
      max: 280        // 最大水平间距
    },
    speed: 4.5,        // 略微降低速度，给玩家更多反应时间
    minY: 100,         // 最低高度
    maxY: 300,         // 最高高度
    minGapY: 60,       // 最小垂直间距
    maxGapY: 120,      // 最大垂直间距
    types: {
      normal: {
        width: 120,    // 标准宽度
        chance: 0.5    // 50%概率
      },
      short: {
        width: 80,     // 短平台
        chance: 0.3    // 30%概率
      },
      long: {
        width: 180,    // 长平台
        chance: 0.2    // 20%概率
      },
      // 添加特殊平台类型
      bouncy: {
        width: 100,     // 弹跳平台
        height: 20,
        chance: 0.1,    // 10%概率
        color: '#4169E1', // 蓝色
        bounceFactor: 1.5, // 弹跳系数
        description: "弹跳更高"
      },
      icy: {
        width: 150,     // 冰面平台，更长但滑
        height: 15,
        chance: 0.1,    // 10%概率
        color: '#ADD8E6', // 浅蓝色
        friction: 0.98,   // 低摩擦力
        description: "表面光滑，会滑动"
      },
      crumbling: {
        width: 120,    // 碎裂平台
        height: 20,
        chance: 0.1,    // 10%概率
        color: '#CD853F', // 淡棕色
        crumbleTime: 45, // 踩上去后经过多少帧会碎裂
        description: "短暂支撑后会碎裂"
      },
      moving: {
        width: 120,    // 移动平台
        height: 20,
        chance: 0.1,    // 10%概率
        color: '#9ACD32', // 黄绿色
        moveDistance: 100, // 移动距离
        moveSpeed: 1.5,   // 移动速度
        description: "上下移动"
      }
    }
  },
  
  // 胡萝卜配置
  carrot: {
    width: 40,
    height: 40,
    spawnInterval: 30, // 更频繁的生成
    minOffset: 50,
    maxOffset: 150,
    types: {
      normal: {
        color: '#FFA500',  // 橙色
        score: 10,
        chance: 0.6,      // 60%概率
        scale: 1.0
      },
      golden: {
        color: '#FFD700',  // 金色
        score: 30,
        chance: 0.2,      // 20%概率
        scale: 1.2,
        effects: {
          points: 2,      // 双倍积分持续3秒
          duration: 180
        }
      },
      crystal: {
        color: '#4169E1',  // 蓝色
        score: 50,
        chance: 0.15,     // 15%概率
        scale: 1.3,
        effects: {
          shield: true,   // 提供一次免伤护盾
          duration: 300
        }
      },
      rainbow: {
        color: '#FF1493', // 粉色
        score: 100,
        chance: 0.05,     // 5%概率
        scale: 1.5,
        effects: {
          magnet: true,   // 吸引附近的胡萝卜
          range: 150,
          duration: 240
        }
      }
    },
    patterns: {
      single: {
        count: 1,
        chance: 0.5
      },
      line: {
        count: 3,
        spacing: 60,
        chance: 0.3
      },
      triangle: {
        count: 3,
        spacing: {x: 50, y: 50},
        chance: 0.15
      },
      circle: {
        count: 6,
        radius: 80,
        chance: 0.05
      }
    },
    combos: {
      timeWindow: 120,    // 2秒内收集的胡萝卜计入连击
      multipliers: [
        {count: 3, multiplier: 1.5},
        {count: 5, multiplier: 2.0},
        {count: 8, multiplier: 3.0}
      ]
    }
  },
  
  // 背景元素配置
  backgroundElements: {
    // 生成频率
    spawnInterval: 60, // 每隔多少帧生成一次背景元素
    maxElements: 20,   // 屏幕上最多同时存在的背景元素数量
    // 主题特定元素
    themeElements: {
      // 森林主题
      forest: {
        elements: [
          {type: 'tree', chance: 0.4, layers: ['back', 'mid']},
          {type: 'cloud', chance: 0.3, layers: ['back']},
          {type: 'flower', chance: 0.2, layers: ['mid', 'front']},
          {type: 'leaf', chance: 0.1, layers: ['mid', 'front']}
        ],
        colors: {
          tree: ['#228B22', '#006400', '#008000'], // 不同深浅的绿色
          cloud: ['rgba(255, 255, 255, 0.8)', 'rgba(240, 240, 240, 0.7)'],
          flower: ['#FF69B4', '#FFB6C1', '#FFC0CB', '#FFFFE0'], // 粉色和黄色系
          leaf: ['#8FBC8F', '#90EE90', '#98FB98'] // 不同深浅的绿色
        }
      },
      // 丛林主题
      jungle: {
        elements: [
          {type: 'tree', chance: 0.5, layers: ['back', 'mid', 'front']},
          {type: 'cloud', chance: 0.1, layers: ['back']},
          {type: 'flower', chance: 0.3, layers: ['mid', 'front']},
          {type: 'leaf', chance: 0.1, layers: ['mid', 'front']}
        ],
        colors: {
          tree: ['#006400', '#004000', '#003000'], // 更深的绿色
          cloud: ['rgba(255, 255, 255, 0.6)', 'rgba(240, 240, 240, 0.5)'], // 更淡
          flower: ['#8B008B', '#9932CC', '#9400D3', '#FFD700'], // 紫色和金色
          leaf: ['#2E8B57', '#3CB371', '#20B2AA'] // 更深的绿色
        }
      },
      // 雪山主题
      snow: {
        elements: [
          {type: 'snowflake', chance: 0.5, layers: ['back', 'mid', 'front']},
          {type: 'cloud', chance: 0.3, layers: ['back']},
          {type: 'mountain', chance: 0.2, layers: ['back']}
        ],
        colors: {
          snowflake: ['#FFFFFF', '#F0F8FF', '#E6E6FA'],
          cloud: ['rgba(255, 255, 255, 0.9)', 'rgba(240, 248, 255, 0.8)'],
          mountain: ['#708090', '#778899', '#B0C4DE'] // 不同深浅的灰蓝色
        }
      },
      // Boss森林主题
      bossForest: {
        elements: [
          {type: 'tree', chance: 0.3, layers: ['back']},
          {type: 'cloud', chance: 0.1, layers: ['back']},
          {type: 'leaf', chance: 0.3, layers: ['mid', 'front']}
        ],
        colors: {
          tree: ['#556B2F', '#3A5F0B', '#2F4F2F'], // 暗绿色
          cloud: ['rgba(169, 169, 169, 0.7)', 'rgba(128, 128, 128, 0.6)'], // 灰色云
          leaf: ['#556B2F', '#8B5A00', '#8B0000'] // 暗绿和棕红，有枯叶感
        }
      },
      // Boss雪山主题
      bossSnow: {
        elements: [
          {type: 'snowflake', chance: 0.6, layers: ['back', 'mid', 'front']},
          {type: 'mountain', chance: 0.2, layers: ['back']},
          {type: 'cloud', chance: 0.2, layers: ['back']}
        ],
        colors: {
          snowflake: ['#FFFFFF', '#F0F8FF', '#00BFFF'], // 雪花和蓝色冰晶
          cloud: ['rgba(176, 196, 222, 0.9)', 'rgba(119, 136, 153, 0.8)'], // 灰蓝色云
          mountain: ['#4682B4', '#5F9EA0', '#87CEEB'] // 蓝色系山脉
        }
      }
    },
    // 动画类型
    animations: {
      tree: 'sway',
      cloud: 'float',
      snowflake: 'float',
      leaf: 'sway',
      flower: 'sway',
      mountain: 'none',
      star: 'fade'
    }
  },
  
  // 关卡配置
  level: {
    duration: 600,
    bossWarningTime: 60,
    totalLevels: 5, // 增加关卡数量
    difficultyIncrease: {
      speed: 0.3,
      gapDecrease: 15
    },
    // 添加关卡主题配置
    themes: [
      {
        name: "森林起始",
        description: "兔子在森林中的初始探险",
        backgroundColor: "#87CEEB", // 天蓝色背景
        groundColor: "#8B4513", // 棕色地面
        platformColor: "#996515", // 棕色平台
        enemyTypes: ["fox"],
        musicTrack: "forest",
        platformDensity: 0.8,
        carrotDensity: 0.6,
        specialPlatformChance: 0.1,
        bossType: null,
        objectives: [
          { type: 'distance', value: 2000, description: "前进20米" },
          { type: 'collect', value: 20, description: "收集20个胡萝卜" }
        ]
      },
      {
        name: "丛林深处",
        description: "更加茂密的丛林，充满了危险",
        backgroundColor: "#458B74", // 深绿色背景
        groundColor: "#006400", // 深绿色地面
        platformColor: "#2E8B57", // 深绿色平台
        enemyTypes: ["fox", "boar"],
        musicTrack: "jungle",
        platformDensity: 0.7,
        carrotDensity: 0.5,
        specialPlatformChance: 0.2,
        bossType: null,
        objectives: [
          { type: 'distance', value: 3000, description: "前进30米" },
          { type: 'collect', value: 30, description: "收集30个胡萝卜" },
          { type: 'defeat', value: 5, description: "击败5个敌人" }
        ]
      },
      {
        name: "森林领主",
        description: "面对森林领主的挑战",
        backgroundColor: "#2F4F4F", // 深石板灰背景
        groundColor: "#8B4513", // 棕色地面
        platformColor: "#CD853F", // 棕色平台
        enemyTypes: ["fox", "boar", "crow"],
        musicTrack: "boss",
        platformDensity: 0.6,
        carrotDensity: 0.4,
        specialPlatformChance: 0.3,
        bossType: "forestLord",
        objectives: [
          { type: 'boss', value: 1, description: "击败森林领主" }
        ]
      },
      {
        name: "雪山冰峰",
        description: "在寒冷的雪山上跳跃",
        backgroundColor: "#F0F8FF", // 冰蓝色背景
        groundColor: "#DCDCDC", // 浅灰色地面
        platformColor: "#ADD8E6", // 浅蓝色平台
        enemyTypes: ["boar", "crow"],
        musicTrack: "snow",
        platformDensity: 0.65,
        carrotDensity: 0.45,
        specialPlatformChance: 0.25,
        bossType: null,
        objectives: [
          { type: 'distance', value: 4000, description: "前进40米" },
          { type: 'collect', value: 40, description: "收集40个胡萝卜" },
          { type: 'combo', value: 8, description: "达成8连击" }
        ]
      },
      {
        name: "冰雪女王",
        description: "挑战冰雪女王的领域",
        backgroundColor: "#B0E0E6", // 粉蓝色背景
        groundColor: "#E0FFFF", // 浅蓝绿色地面
        platformColor: "#87CEFA", // 浅蓝色平台
        enemyTypes: ["boar", "crow"],
        musicTrack: "boss_snow",
        platformDensity: 0.55,
        carrotDensity: 0.35,
        specialPlatformChance: 0.35,
        bossType: "snowQueen",
        objectives: [
          { type: 'boss', value: 1, description: "击败冰雪女王" }
        ]
      }
    ]
  },
  
  // Boss配置
  boss: {
    width: 120,
    height: 120,
    health: 40,
    attackInterval: 75,
    projectileSpeed: 5,
    patterns: ['throw', 'jump', 'rush'],
    damageFromJump: 15,
    invincibleTime: 20
  },
  
  // 游戏UI
  ui: {
    scoreMultiplier: 1,
    comboTimeWindow: 30,
    comboMultiplier: 1.5
  },
  
  // 添加怪物配置
  enemies: {
    types: {
      fox: {
        width: 60,
        height: 40,
        speed: 3,
        damage: 1,
        chance: 0.6,
        jumpForce: -8,
        sprite: {
          color: '#FF8C00',
          secondaryColor: '#FFA500'
        }
      },
      boar: {
        width: 70,
        height: 50,
        speed: 4,
        damage: 2,
        chance: 0.4,
        chargeSpeed: 8,
        sprite: {
          color: '#8B4513',
          secondaryColor: '#A0522D'
        }
      },
      crow: {
        width: 80,
        height: 60,
        speed: 4,
        damage: 1,
        chance: 0.7,  // 增加乌鸦出现概率
        sprite: {
          // 乌鸦精灵图配置
          sheet: {
            width: 512,
            height: 179,
            frameWidth: 128,    // 512/4 列
            frameHeight: 89.5,  // 179/2 行
            framesPerRow: 4,
            totalFrames: 8
          },
          animations: {
            idle: {
              startFrame: 0,
              endFrame: 1,
              speed: 0.15
            },
            fly: {
              startFrame: 2,
              endFrame: 4,
              speed: 0.2
            },
            attack: {
              startFrame: 5,
              endFrame: 7,
              speed: 0.25
            }
          },
          color: '#2F4F4F',      // 深灰色
          secondaryColor: '#4F4F4F'  // 浅灰色
        }
      }
    },
    spawnInterval: 180,
    maxOnScreen: 3
  },
  
  // 道具配置
  powerUps: {
    types: {
      doublePoints: {
        name: "双倍积分",
        duration: 300,  // 持续5秒
        chance: 0.4,   // 40%概率
        sprite: {
          width: 40,
          height: 40,
          color: '#FFD700', // 金色
          symbol: '×2'      // 双倍标志
        }
      },
      shield: {
        name: "护盾",
        duration: 360,  // 持续6秒
        chance: 0.35,  // 35%概率
        sprite: {
          width: 40,
          height: 40,
          color: '#4169E1', // 蓝色
          symbol: '🛡️'      // 盾牌标志
        }
      },
      magnet: {
        name: "磁铁",
        duration: 240,  // 持续4秒
        chance: 0.25,  // 25%概率
        range: 150,    // 吸引范围
        sprite: {
          width: 40,
          height: 40,
          color: '#FF1493', // 粉色
          symbol: '🧲'      // 磁铁标志
        }
      }
    },
    spawnInterval: 180  // 每3秒可能生成一个道具
  },
  
  // 障碍物配置
  obstacles: {
    types: {
      spike: {
        width: 40,
        height: 30,
        damage: 1,
        chance: 0.3,
        sprite: {
          color: '#FF4444',
          points: [[0,30], [20,0], [40,30]] // 三角形地刺
        }
      },
      movingPlatform: {
        width: 120,
        height: 20,
        speed: 2,
        chance: 0.2,
        amplitude: 100, // 移动幅度
        pattern: 'vertical', // 'vertical' 或 'horizontal'
        color: '#8B4513'
      },
      breakablePlatform: {
        width: 120,
        height: 20,
        chance: 0.2,
        breakTime: 60, // 站上去1秒后破碎
        color: '#CD853F',
        crackColor: '#8B4513'
      }
    }
  },
  
  // 特效配置
  effects: {
    particles: {
      jump: {
        count: 5,
        speed: 3,
        size: 4,
        color: '#FFFFFF',
        lifetime: 20
      },
      land: {
        count: 8,
        speed: 2,
        size: 3,
        color: '#A0A0A0',
        lifetime: 15
      },
      powerUp: {
        count: 15,
        speed: 4,
        size: 5,
        lifetime: 30
      }
    },
    screenShake: {
      damage: {
        intensity: 10,
        duration: 15
      },
      land: {
        intensity: 5,
        duration: 10
      }
    }
  },
  
  // 成就系统
  achievements: {
    highJumper: {
      name: "高空跳跃者",
      condition: "连续跳跃3次",
      reward: 100
    },
    speedRunner: {
      name: "速度狂人",
      condition: "保持最大速度运行5秒",
      reward: 150
    },
    carrotKing: {
      name: "胡萝卜之王",
      condition: "收集50个胡萝卜",
      reward: 200
    }
  },
  
  // 添加武器配置
  weapons: {
    types: {
      carrotGun: {
        name: "胡萝卜枪",
        damage: 10,
        cooldown: 20,
        speed: 8,
        size: 20,
        color: '#FFA500',
        sprite: 'carrot',
        description: "发射胡萝卜子弹"
      },
      carrotBomb: {
        name: "胡萝卜炸弹",
        damage: 30,
        cooldown: 60,
        speed: 5,
        size: 30,
        color: '#FF4500',
        sprite: 'carrot',
        explosionRadius: 100,
        description: "爆炸性胡萝卜"
      },
      carrotLaser: {
        name: "胡萝卜激光",
        damage: 15,
        cooldown: 40,
        speed: 12,
        size: 40,
        color: '#FFD700',
        sprite: 'carrot',
        duration: 30,
        description: "快速激光束"
      }
    },
    maxAmmo: {
      carrotGun: 50,
      carrotBomb: 10,
      carrotLaser: 30
    }
  }
}; 